package com.lswms.modules.lswms.dao.base;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lswms.common.dao.BaseDao;
import com.lswms.modules.lswms.entity.base.CargojcEntity;
import com.lswms.modules.lswms.entity.stock.InventoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 货箱检测
 *
 * @author DX sunlightcs@gmail.com
 * @since 1.0.0 2022-02-19
 */
@Mapper
public interface CargojcDao extends BaseDao<CargojcEntity> {

    @Select("select pid from lswms_cargojc")
    List<String> pidNos();

    @Select("select * from lswms_inventory where tray = #{tray} and lot in (select lot from lswms_lot where lot15 = '检测')")
    IPage<InventoryEntity> selectLotWhereLot15(String tray);

    //获取物料表中信息一样且状态不是检测的lot
    @Select("select top 1 lot from lswms_lot where sku = #{sku} and lot15 !='检测'")
    String getlot(String sku);
}